home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Collections.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  20.4 KB  |  765 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Collections.a
  3. ;
  4. ;    Contains:    Collection Manager Interfaces
  5. ;
  6. ;    Version:    Technology:    System 7.x
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1989-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__COLLECTIONS__') = 'UNDEFINED' THEN
  19. __COLLECTIONS__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.  
  28. ; ************
  29. ;  Constants 
  30. ; ************
  31. ;  Convenience constants for functions which optionally return values 
  32.  
  33. kCollectionDontWantTag            EQU        0
  34. kCollectionDontWantId            EQU        0
  35. kCollectionDontWantSize            EQU        0
  36. kCollectionDontWantAttributes    EQU        0
  37. kCollectionDontWantIndex        EQU        0
  38. kCollectionDontWantData            EQU        0
  39.  
  40. ;  attributes bits 
  41.  
  42. kCollectionNoAttributes            EQU        $00000000            ; no attributes bits set 
  43. kCollectionAllAttributes        EQU        $FFFFFFFF            ; all attributes bits set 
  44. kCollectionUserAttributes        EQU        $0000FFFF            ; user attributes bits 
  45. kCollectionDefaultAttributes    EQU        $40000000            ; default attributes - unlocked, persistent 
  46.  
  47. ;  
  48. ;    Attribute bits 0 through 15 (entire low word) are reserved for use by the application.
  49. ;    Attribute bits 16 through 31 (entire high word) are reserved for use by the Collection Manager.
  50. ;    Only bits 31 (kCollectionLockBit) and 30 (kCollectionPersistenceBit) currently have meaning.
  51. ;
  52.  
  53.  
  54. kCollectionUser0Bit                EQU        0
  55. kCollectionUser1Bit                EQU        1
  56. kCollectionUser2Bit                EQU        2
  57. kCollectionUser3Bit                EQU        3
  58. kCollectionUser4Bit                EQU        4
  59. kCollectionUser5Bit                EQU        5
  60. kCollectionUser6Bit                EQU        6
  61. kCollectionUser7Bit                EQU        7
  62. kCollectionUser8Bit                EQU        8
  63. kCollectionUser9Bit                EQU        9
  64. kCollectionUser10Bit            EQU        10
  65. kCollectionUser11Bit            EQU        11
  66. kCollectionUser12Bit            EQU        12
  67. kCollectionUser13Bit            EQU        13
  68. kCollectionUser14Bit            EQU        14
  69. kCollectionUser15Bit            EQU        15
  70. kCollectionReserved0Bit            EQU        16
  71. kCollectionReserved1Bit            EQU        17
  72. kCollectionReserved2Bit            EQU        18
  73. kCollectionReserved3Bit            EQU        19
  74. kCollectionReserved4Bit            EQU        20
  75. kCollectionReserved5Bit            EQU        21
  76. kCollectionReserved6Bit            EQU        22
  77. kCollectionReserved7Bit            EQU        23
  78. kCollectionReserved8Bit            EQU        24
  79. kCollectionReserved9Bit            EQU        25
  80. kCollectionReserved10Bit        EQU        26
  81. kCollectionReserved11Bit        EQU        27
  82. kCollectionReserved12Bit        EQU        28
  83. kCollectionReserved13Bit        EQU        29
  84. kCollectionPersistenceBit        EQU        30
  85. kCollectionLockBit                EQU        31
  86.  
  87. ;  attribute masks 
  88.  
  89. kCollectionUser0Mask            EQU        $00000001
  90. kCollectionUser1Mask            EQU        $00000002
  91. kCollectionUser2Mask            EQU        $00000004
  92. kCollectionUser3Mask            EQU        $00000008
  93. kCollectionUser4Mask            EQU        $00000010
  94. kCollectionUser5Mask            EQU        $00000020
  95. kCollectionUser6Mask            EQU        $00000040
  96. kCollectionUser7Mask            EQU        $00000080
  97. kCollectionUser8Mask            EQU        $00000100
  98. kCollectionUser9Mask            EQU        $00000200
  99. kCollectionUser10Mask            EQU        $00000400
  100. kCollectionUser11Mask            EQU        $00000800
  101. kCollectionUser12Mask            EQU        $00001000
  102. kCollectionUser13Mask            EQU        $00002000
  103. kCollectionUser14Mask            EQU        $00004000
  104. kCollectionUser15Mask            EQU        $00008000
  105. kCollectionReserved0Mask        EQU        $00010000
  106. kCollectionReserved1Mask        EQU        $00020000
  107. kCollectionReserved2Mask        EQU        $00040000
  108. kCollectionReserved3Mask        EQU        $00080000
  109. kCollectionReserved4Mask        EQU        $00100000
  110. kCollectionReserved5Mask        EQU        $00200000
  111. kCollectionReserved6Mask        EQU        $00400000
  112. kCollectionReserved7Mask        EQU        $00800000
  113. kCollectionReserved8Mask        EQU        $01000000
  114. kCollectionReserved9Mask        EQU        $02000000
  115. kCollectionReserved10Mask        EQU        $04000000
  116. kCollectionReserved11Mask        EQU        $08000000
  117. kCollectionReserved12Mask        EQU        $10000000
  118. kCollectionReserved13Mask        EQU        $20000000
  119. kCollectionPersistenceMask        EQU        $40000000
  120. kCollectionLockMask                EQU        $80000000
  121.  
  122. ; **********
  123. ;  Types   
  124. ; **********
  125. ;  abstract data type for a collection 
  126.  
  127.  
  128. ;  collection member 4 byte tag 
  129. ; typedef FourCharCode                     CollectionTag
  130.  
  131. ; ********************************************
  132. ; ************* Public interfaces ************
  133. ; ********************************************
  134. ;
  135. ; pascal Collection NewCollection(void )
  136. ;
  137.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  138.         Macro
  139.         _NewCollection
  140.             moveq               #0,D0
  141.             dc.w                $ABF6
  142.         EndM
  143.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  144.         IMPORT_CFM_FUNCTION NewCollection
  145.     ENDIF
  146.  
  147.  
  148. ;
  149. ; pascal void DisposeCollection(Collection c)
  150. ;
  151.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  152.         Macro
  153.         _DisposeCollection
  154.             moveq               #1,D0
  155.             dc.w                $ABF6
  156.         EndM
  157.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  158.         IMPORT_CFM_FUNCTION DisposeCollection
  159.     ENDIF
  160.  
  161.  
  162. ;
  163. ; pascal Collection CloneCollection(Collection c)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  166.         Macro
  167.         _CloneCollection
  168.             moveq               #2,D0
  169.             dc.w                $ABF6
  170.         EndM
  171.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  172.         IMPORT_CFM_FUNCTION CloneCollection
  173.     ENDIF
  174.  
  175.  
  176. ;
  177. ; pascal SInt32 CountCollectionOwners(Collection c)
  178. ;
  179.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  180.         Macro
  181.         _CountCollectionOwners
  182.             moveq               #3,D0
  183.             dc.w                $ABF6
  184.         EndM
  185.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  186.         IMPORT_CFM_FUNCTION CountCollectionOwners
  187.     ENDIF
  188.  
  189.  
  190. ;
  191. ; pascal Collection CopyCollection(Collection srcCollection, Collection dstCollection)
  192. ;
  193.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  194.         Macro
  195.         _CopyCollection
  196.             moveq               #4,D0
  197.             dc.w                $ABF6
  198.         EndM
  199.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  200.         IMPORT_CFM_FUNCTION CopyCollection
  201.     ENDIF
  202.  
  203.  
  204. ;
  205. ; pascal SInt32 GetCollectionDefaultAttributes(Collection c)
  206. ;
  207.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  208.         Macro
  209.         _GetCollectionDefaultAttributes
  210.             moveq               #5,D0
  211.             dc.w                $ABF6
  212.         EndM
  213.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  214.         IMPORT_CFM_FUNCTION GetCollectionDefaultAttributes
  215.     ENDIF
  216.  
  217.  
  218. ;
  219. ; pascal void SetCollectionDefaultAttributes(Collection c, SInt32 whichAttributes, SInt32 newAttributes)
  220. ;
  221.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  222.         Macro
  223.         _SetCollectionDefaultAttributes
  224.             moveq               #6,D0
  225.             dc.w                $ABF6
  226.         EndM
  227.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  228.         IMPORT_CFM_FUNCTION SetCollectionDefaultAttributes
  229.     ENDIF
  230.  
  231.  
  232. ;
  233. ; pascal SInt32 CountCollectionItems(Collection c)
  234. ;
  235.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  236.         Macro
  237.         _CountCollectionItems
  238.             moveq               #7,D0
  239.             dc.w                $ABF6
  240.         EndM
  241.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  242.         IMPORT_CFM_FUNCTION CountCollectionItems
  243.     ENDIF
  244.  
  245.  
  246. ;
  247. ; pascal OSErr AddCollectionItem(Collection c, CollectionTag tag, SInt32 id, SInt32 itemSize, void *itemData)
  248. ;
  249.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  250.         Macro
  251.         _AddCollectionItem
  252.             moveq               #8,D0
  253.             dc.w                $ABF6
  254.         EndM
  255.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  256.         IMPORT_CFM_FUNCTION AddCollectionItem
  257.     ENDIF
  258.  
  259.  
  260. ;
  261. ; pascal OSErr GetCollectionItem(Collection c, CollectionTag tag, SInt32 id, SInt32 *itemSize, void *itemData)
  262. ;
  263.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  264.         Macro
  265.         _GetCollectionItem
  266.             moveq               #9,D0
  267.             dc.w                $ABF6
  268.         EndM
  269.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  270.         IMPORT_CFM_FUNCTION GetCollectionItem
  271.     ENDIF
  272.  
  273.  
  274. ;
  275. ; pascal OSErr RemoveCollectionItem(Collection c, CollectionTag tag, SInt32 id)
  276. ;
  277.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  278.         Macro
  279.         _RemoveCollectionItem
  280.             moveq               #10,D0
  281.             dc.w                $ABF6
  282.         EndM
  283.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  284.         IMPORT_CFM_FUNCTION RemoveCollectionItem
  285.     ENDIF
  286.  
  287.  
  288. ;
  289. ; pascal OSErr SetCollectionItemInfo(Collection c, CollectionTag tag, SInt32 id, SInt32 whichAttributes, SInt32 newAttributes)
  290. ;
  291.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  292.         Macro
  293.         _SetCollectionItemInfo
  294.             moveq               #11,D0
  295.             dc.w                $ABF6
  296.         EndM
  297.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  298.         IMPORT_CFM_FUNCTION SetCollectionItemInfo
  299.     ENDIF
  300.  
  301.  
  302. ;
  303. ; pascal OSErr GetCollectionItemInfo(Collection c, CollectionTag tag, SInt32 id, SInt32 *index, SInt32 *itemSize, SInt32 *attributes)
  304. ;
  305.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  306.         Macro
  307.         _GetCollectionItemInfo
  308.             moveq               #12,D0
  309.             dc.w                $ABF6
  310.         EndM
  311.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  312.         IMPORT_CFM_FUNCTION GetCollectionItemInfo
  313.     ENDIF
  314.  
  315.  
  316. ;
  317. ; pascal OSErr ReplaceIndexedCollectionItem(Collection c, SInt32 index, SInt32 itemSize, void *itemData)
  318. ;
  319.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  320.         Macro
  321.         _ReplaceIndexedCollectionItem
  322.             moveq               #13,D0
  323.             dc.w                $ABF6
  324.         EndM
  325.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  326.         IMPORT_CFM_FUNCTION ReplaceIndexedCollectionItem
  327.     ENDIF
  328.  
  329.  
  330. ;
  331. ; pascal OSErr GetIndexedCollectionItem(Collection c, SInt32 index, SInt32 *itemSize, void *itemData)
  332. ;
  333.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  334.         Macro
  335.         _GetIndexedCollectionItem
  336.             moveq               #14,D0
  337.             dc.w                $ABF6
  338.         EndM
  339.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  340.         IMPORT_CFM_FUNCTION GetIndexedCollectionItem
  341.     ENDIF
  342.  
  343.  
  344. ;
  345. ; pascal OSErr RemoveIndexedCollectionItem(Collection c, SInt32 index)
  346. ;
  347.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  348.         Macro
  349.         _RemoveIndexedCollectionItem
  350.             moveq               #15,D0
  351.             dc.w                $ABF6
  352.         EndM
  353.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  354.         IMPORT_CFM_FUNCTION RemoveIndexedCollectionItem
  355.     ENDIF
  356.  
  357.  
  358. ;
  359. ; pascal OSErr SetIndexedCollectionItemInfo(Collection c, SInt32 index, SInt32 whichAttributes, SInt32 newAttributes)
  360. ;
  361.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  362.         Macro
  363.         _SetIndexedCollectionItemInfo
  364.             moveq               #16,D0
  365.             dc.w                $ABF6
  366.         EndM
  367.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  368.         IMPORT_CFM_FUNCTION SetIndexedCollectionItemInfo
  369.     ENDIF
  370.  
  371.  
  372. ;
  373. ; pascal OSErr GetIndexedCollectionItemInfo(Collection c, SInt32 index, CollectionTag *tag, SInt32 *id, SInt32 *itemSize, SInt32 *attributes)
  374. ;
  375.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  376.         Macro
  377.         _GetIndexedCollectionItemInfo
  378.             moveq               #17,D0
  379.             dc.w                $ABF6
  380.         EndM
  381.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  382.         IMPORT_CFM_FUNCTION GetIndexedCollectionItemInfo
  383.     ENDIF
  384.  
  385.  
  386. ;
  387. ; pascal Boolean CollectionTagExists(Collection c, CollectionTag tag)
  388. ;
  389.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  390.         Macro
  391.         _CollectionTagExists
  392.             moveq               #18,D0
  393.             dc.w                $ABF6
  394.         EndM
  395.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  396.         IMPORT_CFM_FUNCTION CollectionTagExists
  397.     ENDIF
  398.  
  399.  
  400. ;
  401. ; pascal SInt32 CountCollectionTags(Collection c)
  402. ;
  403.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  404.         Macro
  405.         _CountCollectionTags
  406.             moveq               #19,D0
  407.             dc.w                $ABF6
  408.         EndM
  409.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  410.         IMPORT_CFM_FUNCTION CountCollectionTags
  411.     ENDIF
  412.  
  413.  
  414. ;
  415. ; pascal OSErr GetIndexedCollectionTag(Collection c, SInt32 tagIndex, CollectionTag *tag)
  416. ;
  417.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  418.         Macro
  419.         _GetIndexedCollectionTag
  420.             moveq               #20,D0
  421.             dc.w                $ABF6
  422.         EndM
  423.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  424.         IMPORT_CFM_FUNCTION GetIndexedCollectionTag
  425.     ENDIF
  426.  
  427.  
  428. ;
  429. ; pascal SInt32 CountTaggedCollectionItems(Collection c, CollectionTag tag)
  430. ;
  431.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  432.         Macro
  433.         _CountTaggedCollectionItems
  434.             moveq               #21,D0
  435.             dc.w                $ABF6
  436.         EndM
  437.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  438.         IMPORT_CFM_FUNCTION CountTaggedCollectionItems
  439.     ENDIF
  440.  
  441.  
  442. ;
  443. ; pascal OSErr GetTaggedCollectionItem(Collection c, CollectionTag tag, SInt32 whichItem, SInt32 *itemSize, void *itemData)
  444. ;
  445.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  446.         Macro
  447.         _GetTaggedCollectionItem
  448.             moveq               #22,D0
  449.             dc.w                $ABF6
  450.         EndM
  451.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  452.         IMPORT_CFM_FUNCTION GetTaggedCollectionItem
  453.     ENDIF
  454.  
  455.  
  456. ;
  457. ; pascal OSErr GetTaggedCollectionItemInfo(Collection c, CollectionTag tag, SInt32 whichItem, SInt32 *id, SInt32 *index, SInt32 *itemSize, SInt32 *attributes)
  458. ;
  459.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  460.         Macro
  461.         _GetTaggedCollectionItemInfo
  462.             moveq               #23,D0
  463.             dc.w                $ABF6
  464.         EndM
  465.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  466.         IMPORT_CFM_FUNCTION GetTaggedCollectionItemInfo
  467.     ENDIF
  468.  
  469.  
  470. ;
  471. ; pascal void PurgeCollection(Collection c, SInt32 whichAttributes, SInt32 matchingAttributes)
  472. ;
  473.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  474.         Macro
  475.         _PurgeCollection
  476.             moveq               #24,D0
  477.             dc.w                $ABF6
  478.         EndM
  479.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  480.         IMPORT_CFM_FUNCTION PurgeCollection
  481.     ENDIF
  482.  
  483.  
  484. ;
  485. ; pascal void PurgeCollectionTag(Collection c, CollectionTag tag)
  486. ;
  487.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  488.         Macro
  489.         _PurgeCollectionTag
  490.             moveq               #25,D0
  491.             dc.w                $ABF6
  492.         EndM
  493.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  494.         IMPORT_CFM_FUNCTION PurgeCollectionTag
  495.     ENDIF
  496.  
  497.  
  498. ;
  499. ; pascal void EmptyCollection(Collection c)
  500. ;
  501.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  502.         Macro
  503.         _EmptyCollection
  504.             moveq               #26,D0
  505.             dc.w                $ABF6
  506.         EndM
  507.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  508.         IMPORT_CFM_FUNCTION EmptyCollection
  509.     ENDIF
  510.  
  511. ;
  512. ; pascal OSErr FlattenCollection(Collection c, CollectionFlattenUPP flattenProc, void *refCon)
  513. ;
  514.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  515.         Macro
  516.         _FlattenCollection
  517.             moveq               #27,D0
  518.             dc.w                $ABF6
  519.         EndM
  520.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  521.         IMPORT_CFM_FUNCTION FlattenCollection
  522.     ENDIF
  523.  
  524.  
  525. ;
  526. ; pascal OSErr FlattenPartialCollection(Collection c, CollectionFlattenUPP flattenProc, void *refCon, SInt32 whichAttributes, SInt32 matchingAttributes)
  527. ;
  528.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  529.         Macro
  530.         _FlattenPartialCollection
  531.             moveq               #28,D0
  532.             dc.w                $ABF6
  533.         EndM
  534.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  535.         IMPORT_CFM_FUNCTION FlattenPartialCollection
  536.     ENDIF
  537.  
  538.  
  539. ;
  540. ; pascal OSErr UnflattenCollection(Collection c, CollectionFlattenUPP flattenProc, void *refCon)
  541. ;
  542.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  543.         Macro
  544.         _UnflattenCollection
  545.             moveq               #29,D0
  546.             dc.w                $ABF6
  547.         EndM
  548.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  549.         IMPORT_CFM_FUNCTION UnflattenCollection
  550.     ENDIF
  551.  
  552.  
  553. ;
  554. ; pascal CollectionExceptionUPP GetCollectionExceptionProc(Collection c)
  555. ;
  556.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  557.         Macro
  558.         _GetCollectionExceptionProc
  559.             moveq               #30,D0
  560.             dc.w                $ABF6
  561.         EndM
  562.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  563.         IMPORT_CFM_FUNCTION GetCollectionExceptionProc
  564.     ENDIF
  565.  
  566.  
  567. ;
  568. ; pascal void SetCollectionExceptionProc(Collection c, CollectionExceptionUPP exceptionProc)
  569. ;
  570.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  571.         Macro
  572.         _SetCollectionExceptionProc
  573.             moveq               #31,D0
  574.             dc.w                $ABF6
  575.         EndM
  576.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  577.         IMPORT_CFM_FUNCTION SetCollectionExceptionProc
  578.     ENDIF
  579.  
  580.  
  581. ;
  582. ; pascal Collection GetNewCollection(SInt16 collectionID)
  583. ;
  584.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  585.         Macro
  586.         _GetNewCollection
  587.             moveq               #32,D0
  588.             dc.w                $ABF6
  589.         EndM
  590.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  591.         IMPORT_CFM_FUNCTION GetNewCollection
  592.     ENDIF
  593.  
  594.  
  595. ; *********************************************************************
  596. ; ************** Utility routines for handle-based access *************
  597. ; *********************************************************************
  598. ;
  599. ; pascal OSErr AddCollectionItemHdl(Collection aCollection, CollectionTag tag, SInt32 id, Handle itemData)
  600. ;
  601.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  602.         Macro
  603.         _AddCollectionItemHdl
  604.             moveq               #33,D0
  605.             dc.w                $ABF6
  606.         EndM
  607.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  608.         IMPORT_CFM_FUNCTION AddCollectionItemHdl
  609.     ENDIF
  610.  
  611.  
  612. ;
  613. ; pascal OSErr GetCollectionItemHdl(Collection aCollection, CollectionTag tag, SInt32 id, Handle itemData)
  614. ;
  615.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  616.         Macro
  617.         _GetCollectionItemHdl
  618.             moveq               #34,D0
  619.             dc.w                $ABF6
  620.         EndM
  621.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  622.         IMPORT_CFM_FUNCTION GetCollectionItemHdl
  623.     ENDIF
  624.  
  625.  
  626. ;
  627. ; pascal OSErr ReplaceIndexedCollectionItemHdl(Collection aCollection, SInt32 index, Handle itemData)
  628. ;
  629.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  630.         Macro
  631.         _ReplaceIndexedCollectionItemHdl
  632.             moveq               #35,D0
  633.             dc.w                $ABF6
  634.         EndM
  635.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  636.         IMPORT_CFM_FUNCTION ReplaceIndexedCollectionItemHdl
  637.     ENDIF
  638.  
  639.  
  640. ;
  641. ; pascal OSErr GetIndexedCollectionItemHdl(Collection aCollection, SInt32 index, Handle itemData)
  642. ;
  643.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  644.         Macro
  645.         _GetIndexedCollectionItemHdl
  646.             moveq               #36,D0
  647.             dc.w                $ABF6
  648.         EndM
  649.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  650.         IMPORT_CFM_FUNCTION GetIndexedCollectionItemHdl
  651.     ENDIF
  652.  
  653.  
  654. ;
  655. ; pascal OSErr FlattenCollectionToHdl(Collection aCollection, Handle flattened)
  656. ;
  657.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  658.         Macro
  659.         _FlattenCollectionToHdl
  660.             moveq               #37,D0
  661.             dc.w                $ABF6
  662.         EndM
  663.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  664.         IMPORT_CFM_FUNCTION FlattenCollectionToHdl
  665.     ENDIF
  666.  
  667.  
  668. ;
  669. ; pascal OSErr UnflattenCollectionFromHdl(Collection aCollection, Handle flattened)
  670. ;
  671.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  672.         Macro
  673.         _UnflattenCollectionFromHdl
  674.             moveq               #38,D0
  675.             dc.w                $ABF6
  676.         EndM
  677.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  678.         IMPORT_CFM_FUNCTION UnflattenCollectionFromHdl
  679.     ENDIF
  680.  
  681.  
  682.     IF OLDROUTINENAMES THEN
  683.  
  684. dontWantTag                        EQU        0
  685. dontWantId                        EQU        0
  686. dontWantSize                    EQU        0
  687. dontWantAttributes                EQU        0
  688. dontWantIndex                    EQU        0
  689. dontWantData                    EQU        0
  690.  
  691. noCollectionAttributes            EQU        $00000000
  692. allCollectionAttributes            EQU        $FFFFFFFF
  693. userCollectionAttributes        EQU        $0000FFFF
  694. defaultCollectionAttributes        EQU        $40000000
  695.  
  696. collectionUser0Bit                EQU        0
  697. collectionUser1Bit                EQU        1
  698. collectionUser2Bit                EQU        2
  699. collectionUser3Bit                EQU        3
  700. collectionUser4Bit                EQU        4
  701. collectionUser5Bit                EQU        5
  702. collectionUser6Bit                EQU        6
  703. collectionUser7Bit                EQU        7
  704. collectionUser8Bit                EQU        8
  705. collectionUser9Bit                EQU        9
  706. collectionUser10Bit                EQU        10
  707. collectionUser11Bit                EQU        11
  708. collectionUser12Bit                EQU        12
  709. collectionUser13Bit                EQU        13
  710. collectionUser14Bit                EQU        14
  711. collectionUser15Bit                EQU        15
  712. collectionReserved0Bit            EQU        16
  713. collectionReserved1Bit            EQU        17
  714. collectionReserved2Bit            EQU        18
  715. collectionReserved3Bit            EQU        19
  716. collectionReserved4Bit            EQU        20
  717. collectionReserved5Bit            EQU        21
  718. collectionReserved6Bit            EQU        22
  719. collectionReserved7Bit            EQU        23
  720. collectionReserved8Bit            EQU        24
  721. collectionReserved9Bit            EQU        25
  722. collectionReserved10Bit            EQU        26
  723. collectionReserved11Bit            EQU        27
  724. collectionReserved12Bit            EQU        28
  725. collectionReserved13Bit            EQU        29
  726. collectionPersistenceBit        EQU        30
  727. collectionLockBit                EQU        31
  728.  
  729. collectionUser0Mask                EQU        $00000001
  730. collectionUser1Mask                EQU        $00000002
  731. collectionUser2Mask                EQU        $00000004
  732. collectionUser3Mask                EQU        $00000008
  733. collectionUser4Mask                EQU        $00000010
  734. collectionUser5Mask                EQU        $00000020
  735. collectionUser6Mask                EQU        $00000040
  736. collectionUser7Mask                EQU        $00000080
  737. collectionUser8Mask                EQU        $00000100
  738. collectionUser9Mask                EQU        $00000200
  739. collectionUser10Mask            EQU        $00000400
  740. collectionUser11Mask            EQU        $00000800
  741. collectionUser12Mask            EQU        $00001000
  742. collectionUser13Mask            EQU        $00002000
  743. collectionUser14Mask            EQU        $00004000
  744. collectionUser15Mask            EQU        $00008000
  745. collectionReserved0Mask            EQU        $00010000
  746. collectionReserved1Mask            EQU        $00020000
  747. collectionReserved2Mask            EQU        $00040000
  748. collectionReserved3Mask            EQU        $00080000
  749. collectionReserved4Mask            EQU        $00100000
  750. collectionReserved5Mask            EQU        $00200000
  751. collectionReserved6Mask            EQU        $00400000
  752. collectionReserved7Mask            EQU        $00800000
  753. collectionReserved8Mask            EQU        $01000000
  754. collectionReserved9Mask            EQU        $02000000
  755. collectionReserved10Mask        EQU        $04000000
  756. collectionReserved11Mask        EQU        $08000000
  757. collectionReserved12Mask        EQU        $10000000
  758. collectionReserved13Mask        EQU        $20000000
  759. collectionPersistenceMask        EQU        $40000000
  760. collectionLockMask                EQU        $80000000
  761.     ENDIF    ; OLDROUTINENAMES
  762.  
  763.     ENDIF ; __COLLECTIONS__ 
  764.  
  765.